#encoding=utf-8
'''
Created on 2014-04-24

@author: cooler
'''

'''
 
'''

import redis, logging
from Config import initConfig

def getDB(db):
    config = initConfig()
    host = config.get("redis","host")
    # host_bak = config.get("redis","host_bak")
    port = config.get("redis","port")
    password = config.get("redis","password")
    r = redis.Redis(host=host, port=port, db=db, password=password)  
    return r

'''

'''
if __name__ == '__main__':
    rdb = getDB(5)
    print rdb
    for x in xrange(1,40):
        rdb.set("d"+str(x),"dd"+str(x))